package com.thkj.modules.check.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thkj.modules.check.entity.TblCheck;
import com.thkj.modules.check.entity.TblReform;
import com.thkj.modules.check.service.TblCheckService;
import com.thkj.modules.check.service.TblReformService;

import dp.service.BaseService;

@Service
public class TblReformServiceImpl extends BaseService implements TblReformService {

	@Autowired
	TblCheckService tblCheckService;

	@Transactional
	public void insertTblReform(TblReform t) {
		dao.insert("com.thkj.mapper.TblReform.insert", t);
		TblCheck tblCheck = new TblCheck();
		tblCheck.setId(t.getCheckId());
		tblCheck.setResult("-1");
		tblCheckService.updateResult(tblCheck);
	}

	public int updateTblReform(TblReform t) {
		int row = dao.update("com.thkj.mapper.TblReform.update", t);
		return row;
	}

	public int deleteTblReform(String t) {
		return dao.delete("com.thkj.mapper.TblReform.delete", t);
	}

	public TblReform getTblReformById(String t) {
		return dao.queryForObject("com.thkj.mapper.TblReform.getById", t, TblReform.class);
	}

	@Override
	public List<Map> query(String t) {
		return dao.queryForList("com.thkj.mapper.TblReform.query", t, Map.class);
	}

}